// imgWriter.h: interface for the imgWriter class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_IMGWRITER_H__B7F400FA_27F4_4925_8F4C_4CF5C8A40C8D__INCLUDED_)
#define AFX_IMGWRITER_H__B7F400FA_27F4_4925_8F4C_4CF5C8A40C8D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <string>
using namespace std;

typedef struct s_BM_header {
	WORD BMP_id ; // 'B''M'
	DWORD size; // size in bytes of the BMP file
	DWORD zero_res; // 0
	DWORD offbits; // 54
	DWORD biSize; // 0x28
	DWORD Width;  // X
	DWORD Height;  // Y
	WORD  biPlanes; // 1
	WORD  biBitCount ; // 24
	DWORD biCompression; // 0 = BI_RGB
	DWORD biSizeImage; // 0
	DWORD biXPelsPerMeter; // 0xB40
	DWORD biYPelsPerMeter; // 0xB40
	DWORD biClrUsed; //0
	DWORD biClrImportant; //0
} stBM_header;


class imgWriter : public CObject  
{
public:
	imgWriter();
	imgWriter(string const  &strPath);
	virtual ~imgWriter();
	int SaveToBMP2(UCHAR const * pData, string const & strPath = "");
	int SaveToBMP(UCHAR const * pData, string const & strPath = "");
	void SetFilePath(string const & strPath);
	void SetImageDimension(int nWidth, int nHight);
	int SaveToBMP(UCHAR const  * pData,  int nWidth, int nHight, string const & strPath = "");

private:
	string	m_strFilePath;
	int m_nWidth;
	int	m_nHeight;


};

#endif // !defined(AFX_IMGWRITER_H__B7F400FA_27F4_4925_8F4C_4CF5C8A40C8D__INCLUDED_)
